<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
  import {alipayHideOptionMenu} from './utils/alipayJsApi'
  import {setTitle, setFontSize} from './utils/public'

  const {showUrl} = global.lineConfig.global

  export default {
    name: 'app',
    mounted() {
      // sessionStorage.setItem('userId','2088202874791556')
      this.onReady()
      this.routerChange()
    },
    methods: {
      onReady() {
        setTitle(this.$route.path.replace('/', ''))
        setFontSize(720)
        if (showUrl) alipayHideOptionMenu()
      },
      routerChange() {
        this.$router.beforeEach((to, from, next) => {
          setTitle(to.path.replace('/', ''))
          if (showUrl) alipayHideOptionMenu()
          next()
        })
      }
    }
  }
</script>
